
<div id="comments">
#if(article.allowComment)
<div class="block">
	#set( comments = comments(10) )
    <p class="ui red ribbon label comments">${comments_num('还不快抢沙发','已有 %d 人抢先你了')}</p>
     #if(!is_empty(comments))
	 <ol class="comment-list">
        #for(comment : comments.rows)
        <li data-no-instant="" id="comment-${comment.coid}" class="comment-body comment-parent comment-odd">
            <div id="div-comment-${comment.coid}">
                
                <div class="comment-main">
				
					<div class="comment-author">
					<img class="avatar" src="${gravatar(comment.mail)}?s=80&r=G&d=" alt="${comment.author}" width="32" height="32">					
					<cite class="fn"><a href="${comment.url}" target="_blank" rel="external nofollow">${comment.author}</a></cite>
					</div>
                    
                    <div class="comment-meta">
					<a >${fmtdate(comment.created)}</a>
					</div>
					
					<p class="comment-at">${article(comment.content)}</p>
					#if(comment.levels > 0)
						<div class="comment-children">
							<ol class="comment-list">
								#for(child : comment.children)
								<li data-no-instant="" id="comment-${child.coid}" class="comment-body comment-child comment-level-odd comment-odd comment-by-author">
									<div id="div-comment-${child.coid}">

										<div class="comment-main">
											<div class="comment-author">
											<img class="avatar" src="${gravatar(child.mail)}?s=80&r=G&d=" alt="${child.author}" width="32" height="32">					
											<cite class="fn"><a href="${child.url}" target="_blank" rel="external nofollow">${child.author}</a></cite>
											</div>
											
											<div class="comment-meta">
											<a >${fmtdate(child.created)}</a>
											</div>
											
											<p class="comment-at">${article(child.content)}</p>
											
											<div class="comment-reply">
											<a href="/?replyTo=${child.coid}#respond-post-1" rel="nofollow" onclick="return TypechoComment.reply('comment-${child.coid}','${child.coid}');">回复</a>
											</div>
										</div>
									</div>
								</li>
								#end
							</ol>
						</div>
					#end
					<div class="comment-reply">
						<a href="/?replyTo=${comment.coid}#respond-post-1" rel="nofollow" onclick="return TypechoComment.reply('comment-${comment.coid}','${comment.coid}');">回复</a>
					</div>
                </div>
            </div>
            
        </li>
        #end
        </ol>
        #if(comments.totalRows>10)
	    <div class="lists-navigator clearfix">
	            <ol class="page-navigator">
	                #if(comments.hasPrevPage)
	                <li class="prev"><a href="?cp=${comments.prevPage}#comments">←</a></li>
	                #end
	                #for(navIndex : comments.navPageNums)
	                <li #if(comments.pageNum== navIndex) class="current" #end><a href="?cp=${navIndex}#comments">${navIndex}</a></li>
	                #end
	                #if(comments.hasNextPage)
	                <li class="next"><a href="?cp=${comments.nextPage}#comments">→</a></li>
	                #end
	            </ol>
	
	        </div>
     	#end
	 #end

</div>

<div class="block new-comment" id="respond-post-1">
    <div >
      	<a id="cancel-comment-reply-link" href="/#respond-post-1" rel="nofollow" style="display:none;" onclick="return TypechoComment.cancelReply();">取消回复</a>
    </div>
   	<p class="ui ribbon label red">添加新评论</p>
   	<form method="post" id="comment-form"  onsubmit="return TaleComment.subComment();" class="ui fluid form">
		<input type="hidden" name="coid" id="coid"/>
	  #if(null!=login_user)
        <div class="field">登录身份：
		<a href="${login_user.home_url}"></a>${login_user.username}. <a href="/logout" title="Logout">退出 &raquo;</a></div>
         #end
		 
		 
		<input type="hidden" name="cid" id="cid" value="${article.cid}"/>
		<input type="hidden" name="csrf_token" value="${csrf_token}"/>
		
        <div class="two fields">
            <div class="field">
                <input type="text" name="author" placeholder="称呼 (必填)') "value="${login_user.username ?! ''}" required />
            </div>
            <div class="field">
                <input type="email" name="mail" placeholder="电子邮件 (必填) (http://)" value="${login_user.email ?! ''}" required/>
            </div>
        </div>
        <div class="field">
            <input type="url" name="url" placeholder="个人主页 (必填)" value="${login_user.home_url ?! ''}" required/>
        </div>
        

        <div class="field">
            <textarea rows="8" cols="50" id="comment-content" placeholder="回复内容 (必填)')?>" name="content" required></textarea>
        </div>
        <button type="submit" id="comment-submit" class="button red">提交评论 (Ctrl + Enter)</button>
    </form>
</div>

	#else
	<div class="block">
		<p class="ui ribbon label red">楼主残忍的关闭了评论</p>
	</div>
	#end
</div>

